<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    * {
      list-style: none;
      border: 0;
      padding: 0;
      margin: 0;
    }
    ul {
      width: 500px;
      height: 200px;
      background: red;
      display: flex;
      margin: auto;
      margin-top: 100px;
      padding: 0 5px;
      align-items: center;
      /* justify-content: center; */
    }
    li {
      background: green;
      height: 100px;
      width: 500px;
      /* flex: 1 1 33.33%; */
      /* 或者flex设置为 1 1 33.33% */
      flex: auto;
      margin: 2px;
    }
  </style>
  <body>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
    </ul>
  </body>
</html>
